window.onload=initLinks;
var mypic=new Array("image/1.jpg","image/2.jpg","image/3.jpg","image/4.jpg");
//定义数组来存放图片地址
var thispic=0;
function initLinks(){
    document.getElementById('befLink').onclick=turnNex;
    document.getElementById('nexLink').onclick=turnNex;
    document.getElementById('befLink1').onclick=turnNex;
    document.getElementById('nexLink1').onclick=turnBef;
}
function turnBef(){
    if(thispic==0){
        thispic=mypic.length;
    }
    thispic--;
    document.getElementById('tplbimg').src=mypic[thispic];
    return false;
}
function turnNex(){
    thispic++;
    if(thispic==mypic.length){
        thispic=0;
    }
    document.getElementById('tplbimg').src=mypic[thispic];
    return false;
}